package flexUnitTests.testCases
{
	import com.competentum.engines.BindsEngine;
	import com.competentum.engines.CommandPanelEngine;
	import com.competentum.engines.EmployeesEngine;
	import com.competentum.engines.EngineFactory;
	import com.competentum.engines.InputOutputEngine;
	import com.competentum.engines.ProjectsEngine;
	import com.competentum.engines.ShortCutsEngine;
	import com.competentum.lib.engines.AbstractEngine;
	import com.competentum.lib.engines.AbstractEngineFactory;
	
	import org.flexunit.asserts.assertEquals;

	public class AbstractEngineFactoryTest
	{	
		
		private static var abstractEngineFactory:AbstractEngineFactory = new AbstractEngineFactory();
		private var abstractEngine:AbstractEngine;
		
		[Before]
		public function setUp():void
		{
		}
		
		[After]
		public function tearDown():void
		{
		}
		
		[BeforeClass]
		public static function setUpBeforeClass():void
		{
		}
		
		[AfterClass]
		public static function tearDownAfterClass():void
		{
		}
		
		[Test]
		public function testAbstractEngineFactory():void
		{
			var isAllEnginesCreated:Boolean = true;
			
			var factory:EngineFactory = new EngineFactory();
			
			abstractEngine = factory.getEngine(BindsEngine.TYPE);
			if(!(abstractEngine is BindsEngine)){
				isAllEnginesCreated = false;
			}
			
			abstractEngine = factory.getEngine(CommandPanelEngine.TYPE);
			if(!(abstractEngine is CommandPanelEngine)){
				isAllEnginesCreated = false;
			}
			
			abstractEngine = factory.getEngine(EmployeesEngine.TYPE);
			if(!(abstractEngine is EmployeesEngine)){
				isAllEnginesCreated = false;
			}
			
			abstractEngine = factory.getEngine(InputOutputEngine.TYPE);
			if(!(abstractEngine is InputOutputEngine)){
				isAllEnginesCreated = false;
			}
			
			abstractEngine = factory.getEngine(ProjectsEngine.TYPE);
			if(!(abstractEngine is ProjectsEngine)){
				isAllEnginesCreated = false;
			}
			
			abstractEngine = factory.getEngine(ShortCutsEngine.TYPE);
			if(!(abstractEngine is ShortCutsEngine)){
				isAllEnginesCreated = false;
			}
			
			assertEquals(isAllEnginesCreated, true);
		}
	}
}